Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Notes and Domino Application Development wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Developing Applications > Developing Form- and View-based Applications > Using the CKEditor in the Classic Web Server
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Community articleUsing the CKEditor in the Classic Web Server
Added by ~Paul Minalitoden | Edited by IBM contributor~Paul Minalitoden on May 25, 2011 | Version 28
expanded Abstract
collapsed Abstract
The CKEditor can be used as an HTML editor for "classic web server" rich text fields by adding the proper control template and changing the browser.cnf and notes.ini files
Tags: 8.5.2, example
In the classic web server, the JavaScript rich text editor controls are generated to the HTML output page using HTML templates that reside in the Domino server data directory.

Specifically, the template that ships with Domino:
    domino-data-directory/domino/template/dojo-version/dom_richtext.htm
uses the Dojo rich text edit control. New templates can be added to connect to different rich text editors (the CKEditor for this article) by using a combination of template files, notes.ini settings and browser.cnf changes. (browser.cnf is in the domino data directory)

Here is an example dom_richtext_ck.htm file that was built by copying and modifying the dom_richtext.htm file. The new template connects directly to the CKEditor that is installed with 8.5.2.

Save this example as the file domino-data-directory/domino/template/dojo-version/dom_richtext_ck.htm.
The version is the current Dojo version. There may be more than one Dojo directories installed. Use the latest, unless you have specifically chosen to configure the server to use a different version of Dojo.

&DOMINO_CTRL_HEAD;

<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>

<script language="JavaScript" type="text/javascript">

CKEDITOR.config.toolbar_Domino =

    [

	['Font','FontSize'],

	['Bold','Italic','Underline','Strike', '-', 'Subscript','Superscript'],

	['TextColor', 'BGColor'],

	['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', '-', 'NumberedList','BulletedList'],

	['Indent','Outdent', 'Blockquote'],

	['MenuPaste'],

	['Table', 'HorizontalRule', 'SpecialChar'],

	['MenuLink'],

	['Maximize', '-', 'Source']

    ];

CKEDITOR.config.toolbar = "Domino";



CKEDITOR.config.fontSize_sizes='1;2;3;4;5;6;7';

CKEDITOR.config.fontSize_style= { element: 'font', attributes : { 'size' : '#(size)' } };

CKEDITOR.config.font_names = 'Arial;Comic Sans MS;Courier New;Lucida Sans Unicode;Tahoma;Times New Roman;sans-serif;serif;monospace';

CKEDITOR.config.font_style = { element: 'font', attributes : { 'face' : '#(family)' } };

  var rteList = new Array();

  function GetJSEditorData() {

	for (var j=0; j < rteList.length; j++) {

		rteList[j](null);

	}

	return true;

  };



</script>

&DOMINO_CTRL_HEAD_END;

&DOMINO_CTRL_FORM_ID;&DOMINO_CTRL_FORMNAME;&DOMINO_CTRL_FORM_ID_END;

&DOMINO_CTRL_POST;GetJSEditorData()&DOMINO_CTRL_POST_END;

&DOMINO_CTRL_BODY;<div class="domino-richtext"><textarea name="tb&DOMINO_CTRL_FLDNAME;" id="tb&DOMINO_CTRL_FLDNAME;">&DOMINO_CTRL_FLDVALUE;</textarea></div>

&DOMINO_CTRL_BODY_END;

&DOMINO_CTRL_FLD_INIT;

<input name="&DOMINO_CTRL_FLDNAME;" type="hidden" value="" ID="&DOMINO_CTRL_FLDNAME;">

<script type="text/javascript">

  function get&DOMINO_CTRL_FLDNAME;() {

    document.getElementById('&DOMINO_CTRL_FLDNAME;').value = CKEDITOR.instances.tb&DOMINO_CTRL_FLDNAME;.getData();

    return true;

  }

  rteList.push(get&DOMINO_CTRL_FLDNAME;);

</script>

<script type="text/javascript">

	CKEDITOR.replace('tb&DOMINO_CTRL_FLDNAME;');

</script>&DOMINO_CTRL_FLD_INIT_END;



Then let the web server know about this file by adding a line to the server's notes.ini:

WebRichTextEditorTemplates=dom_richtext_ck.htm

Note: This INI can be a comma separated list of template names -- so you can have several custom templates.

Finally, choose which browser(s) will use the editor and make an entry in the domino-data-directory/browser.cnf.
The rule below will use the dom_richtext_ck.html template for all Chrome, Safari, and MSIE browsers.
Note: you may want to restrict this based on browser version, especially for early version of MSIE.

Property WebRichTextEditorTemplateID Number 0

    Rule 1 Chrome

    Rule 1 Safari

    Rule 1 MSIE



The number value ("1" in the example) matches the relative position (starting at 1) of the control template in the WebRichTextEditorTemplates list in notes.ini

Note: values of WebRichTextEditorTemplateID
 
0 override the design-time choice of rich text item editor for any value other than "Using HTML" in the "Web Access : Display" property. So in the example above, the CKEditor will be used for MSIE even it at design time it was set to "Using Java Applet". This browser.cnf property also overrides RTEditorBestFit as described in Controlling Best Fit for OS editor with browser.cnf

Usage notes:
  • many of the limitations of the classic web server HTML rich text editing remain, such as
    • Embedded images: lost on save
    • embedded file attachments: location in file lost -- they all appear at the end of the document.
    • tabbed tables: all but the visible tab is lost
    • hidden "hide when" objects are lost when saved
    • buttons and other "advanced" notes editor constructs: lost or degraded to not operate
  • The example configures the CKEditor to use <font> tags and size attribute for font size changes instead of span with css. This is to produce HTML that is compatible with the notes editor's HTML rendering as well as the notes HTML to Rich Text converter
  • Depending on the specific version of the CKEditor you use, there may be some problems with Internet Explorer in quirks mode (http://dev.ckeditor.com/ticket/5243external link).  One example is that the UI for adding URL links is formatted incorrectly.   META tags or DOCTYPE can be used to put the browser in standards mode.  (See HTMLOptions and HTMLTagAttribute fields)
expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (30)
collapsed Versions (30)
Version Comparison     
VersionDateChanged by              Summary of changes
30Oct 10, 2011, 6:41:07 PM~Naomi Bretooplopakoi  IBM contributorAdd the toolbar config to the CKEDITOR.replace call. Need to do it th...
29Oct 10, 2011, 2:45:58 PM~Paul Minalitoden  IBM contributoruse DIV to surround rich text data instead of TEXTAREA
This version (28)May 25, 2011, 9:45:10 PM~Paul Minalitoden  IBM contributor
27May 25, 2011, 9:40:13 PM~Paul Minalitoden  IBM contributor
26May 25, 2011, 1:51:10 AM~Paul Minalitoden  IBM contributor
25May 25, 2011, 1:50:24 AM~Paul Minalitoden  IBM contributor
24Aug 4, 2010, 6:09:43 PM~Autumn Ektoogen  IBM contributor
23Aug 4, 2010, 4:22:23 PM~Autumn Ektoogen  IBM contributor
22Aug 4, 2010, 3:07:47 PM~Autumn Ektoogen  IBM contributor
21Aug 4, 2010, 3:07:14 PM~Autumn Ektoogen  IBM contributor
20Aug 4, 2010, 2:18:40 PM~Autumn Ektoogen  IBM contributor
19Aug 3, 2010, 9:28:10 PM~Autumn Ektoogen  IBM contributor
18Aug 3, 2010, 8:56:02 PM~Autumn Ektoogen  IBM contributor
17Aug 3, 2010, 8:38:49 PM~Autumn Ektoogen  IBM contributor
16Aug 3, 2010, 7:54:47 PM~Autumn Ektoogen  IBM contributor
15Aug 3, 2010, 7:51:09 PM~Autumn Ektoogen  IBM contributor
14Aug 3, 2010, 7:35:14 PM~Autumn Ektoogen  IBM contributor
13Aug 3, 2010, 7:32:01 PM~Autumn Ektoogen  IBM contributor
12Aug 3, 2010, 7:15:43 PM~Autumn Ektoogen  IBM contributor
11Aug 3, 2010, 7:15:40 PM~Autumn Ektoogen  IBM contributor
10Aug 3, 2010, 5:56:20 PM~Autumn Ektoogen  IBM contributor
9Aug 3, 2010, 5:54:21 PM~Autumn Ektoogen  IBM contributor
8Aug 3, 2010, 5:50:06 PM~Autumn Ektoogen  IBM contributor
7Aug 3, 2010, 5:49:21 PM~Autumn Ektoogen  IBM contributor
6Aug 3, 2010, 5:45:55 PM~Autumn Ektoogen  IBM contributor
5Aug 3, 2010, 5:41:30 PM~Autumn Ektoogen  IBM contributor
4Aug 3, 2010, 5:40:49 PM~Autumn Ektoogen  IBM contributor
3Aug 3, 2010, 5:38:50 PM~Autumn Ektoogen  IBM contributor
2Aug 3, 2010, 5:35:38 PM~Autumn Ektoogen  IBM contributor
1Aug 3, 2010, 5:34:27 PM~Paul Minalitoden  
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL
  • Privacy
  • Accessibility